#ifndef GAMEVIEW_H
#define GAMEVIEW_H

#include <QWidget>
#include <QPainter>
#include <QPixmap>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QTimer>

#include "gamecontrol.h"

class GameControl;

class GameView : public QWidget
{
    Q_OBJECT
    int gameAraeH;
    int gameAraeW;
    int celW;
    int celH;
    int row;
    int cursorX;
    int cursorY;
    GameControl *controller;
    QPixmap *gameAera;
    QPixmap *tmpGameAera;
    QTimer *time;

public:
    explicit GameView(QWidget *parent = 0);

    void initGame();
    void reInit();
    void setPlaying(bool b);
    void paintEvent(QPaintEvent *);
    void mousePressEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent *event);
    void drawCel();
    void drawChess(int x, int y);
    void drawCursor(QPoint p);
    QPoint calculateXY(QPoint p);

signals:

public slots:
    void computerMove();
};

#endif // GAMEVIEW_H
